﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro;

public class SetThePuzzle : MonoBehaviour
{
    public TMP_InputField puzzleInputText;
    public GameObject scriptObject;
    string puzzleText;
    // Start is called before the first frame update
    void Start()
    {
    }

    // Update is called once per frame
    void Update()
    {
        
    }
    public void setPuzzle()
    {
        puzzleText = puzzleInputText.text;
        if (scriptObject.GetComponent<GameManager>().isInDict(puzzleText))
        {
            puzzleInputText.text = scriptObject.GetComponent<GameManager>().getPuzzleCode(puzzleText).ToString();
        }
        else
        {
            puzzleInputText.text = "Not in word list";
        }
    }
}
